<?php

namespace app\api\model;

use think\Model;

class Link extends Model
{
    protected $name = 'link';

    /**
     * 友情链接
     * @param $language
     * @param int $linkcata_id
     */
    public static function getList($language,$linkcata_id = 2){
        $file='logo,url,'.file_language('title',$language);
        $data = self::where('linkcata_id',2)->where('status',1)->field($file)->select();
        foreach ($data as &$v){
            $v['logo'] = 'http://'.$_SERVER['HTTP_HOST'].$v['logo'];
        }
        return $data;
    }

}